<?php

//get list model
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_VERBOSE, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
    curl_setopt($ch, CURLOPT_URL, "http://localhost/wekaws/list_model_service.php");
    curl_setopt($ch, CURLOPT_POST, true);
    $post = array();
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
    $models = curl_exec($ch);
    $models = json_decode($models);
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Mushroom Clasification</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<LINK href="Style.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <div class="title">
			Classify Your Mushroom Before Eat!
		</div>
        <button onclick="javascript:window.location='Learning.php'" value="Learning"> Learn New Model </button>
                <button onclick="javascript:window.location='Classification.php'" value="Classification"> Classify </button>
                <button onclick="javascript:window.location='download.php'" value="Allmodel"> List All Model </button>
		<hr>
		<div class="content">
			<h3>Download your file !</h3>
			<div style="margin-left:20px">
				<table border="1" width=50%>
					<tr>
					<td width="55%">Models</td>
					<td width="35%">Date</td>
					<td width="20%">Time</td>
					</tr><tr>
                                    <?php
                                        foreach ($models as $model) {
                                    ?>
					<td><a href="<?php echo $model->link?>"><?php echo $model->model_name ?></a></td>
					<td><?php echo $model->date?></td>
					<td><?php echo $model->time?></td>
					</tr>
                                    <?
                                        }
                                    ?>
				</table>
			</div>
		</div>
    </body>
</html>
